package com.xinruke.hostels.finance.controller;

import com.xinruke.hostels.common.vo.ResultVO;
import com.xinruke.hostels.finance.interfaces.dto.UserBalanceQueryDto;
import com.xinruke.hostels.finance.interfaces.dto.UserBalanceQueryResultDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName UserFinanceController
 * @CreateDate 2019/6/9
 * @Author FengXinQiang
 * @Version V1.0.0.0
 * @Decription 用户资金
 */
@RestController
@RequestMapping("user/finance")
@Api(tags = "用户资金")
public class UserFinanceController {

    @PostMapping("balance")
    @ApiOperation("查询用户余额")
    public ResultVO<UserBalanceQueryResultDTO> balance(@RequestBody UserBalanceQueryDto userBalanceQueryDto) {
        ResultVO resultVO = ResultVO.success();

        UserBalanceQueryResultDTO userBalanceQueryResultDTO = new UserBalanceQueryResultDTO();
        userBalanceQueryResultDTO.setBalance("用户[" + userBalanceQueryDto.getUserId() + "]财务系统，测试余额12.30");

        resultVO.setData(userBalanceQueryResultDTO);
        return resultVO;
    }
}
